package com.uwlaser.service.dto;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 获取工单请求参数
 */
@Data
public class GetWorkOrderResult {

    @ApiModelProperty("工单信息")
    private WorkOrder workOrder;

    @ApiModelProperty("产品信息")
    private Product product;

    public void setWorkOrder(String workOrderCode, String lineCode, String sectionCode, String orderStatus, Integer requiredQty, Integer finishQty, Integer failQty, String planStart, String planEnd) {
        this.workOrder = new WorkOrder(workOrderCode,lineCode,sectionCode,orderStatus,requiredQty,finishQty,failQty,planStart,planEnd);
    }

    public void setProduct(String productType,String productCode , String productName) {
        this.product = new Product(productType, productCode, productName);
    }

    @Data
    public class WorkOrder {

        @ApiModelProperty("工单编号")
        private String workOrderCode;

        @ApiModelProperty("产线编号")
        private String lineCode;

        @ApiModelProperty("工段编号")
        private String sectionCode;

        @ApiModelProperty("工单状态")
        private String orderStatus;

        @ApiModelProperty("需求数量")
        private Integer requiredQty;

        @ApiModelProperty("完成数量")
        private Integer finishQty;

        @ApiModelProperty("失败数量")
        private Integer failQty;

        @ApiModelProperty("计划开始时间")
        private String planStart;

        @ApiModelProperty("计划结束时间")
        private String planEnd;

        public WorkOrder(String workOrderCode, String lineCode, String sectionCode, String orderStatus, Integer requiredQty, Integer finishQty, Integer failQty, String planStart, String planEnd) {
            this.workOrderCode = workOrderCode;
            this.lineCode = lineCode;
            this.sectionCode = sectionCode;
            this.orderStatus = orderStatus;
            this.requiredQty = requiredQty;
            this.finishQty = finishQty;
            this.failQty = failQty;
            this.planStart = planStart;
            this.planEnd = planEnd;
        }
    }

    @Data
    public class Product {

        @ApiModelProperty("产品类型")
        private String productType;

        @ApiModelProperty("产品型号")
        private String productCode;

        @ApiModelProperty("产品名称")
        private String productName;

        public Product(String productType, String productCode, String productName) {
            this.productType = productType;
            this.productCode = productCode;
            this.productName = productName;
        }
    }
}
